import React, { useState } from "react";
import style from "./style.module.scss";
import pickerIcon from "../../assets/images/icon/common resource/hdpi/circle_icon_drop_down_n.png";
import { PickerPopupActions } from "react-vant";

interface PropsType {
  tooltip: string;
  type: string;
  dateTime: string;
  actions: PickerPopupActions;
  getTime: (actions: PickerPopupActions, type: string) => void;
}

export const ProFilePicker: React.FC<PropsType> = ({
  tooltip,
  type,
  dateTime,
  getTime,
  actions,
}) => {
  const [value, setValue] = useState<string>(dateTime);
  return (
    <div
      className={style.proFile_picker_wrapper}
      onClick={() => getTime(actions, type)}
    >
      <input
        type="text"
        className={style.proFile_picker}
        placeholder={tooltip}
        value={dateTime}
        onChange={() => setValue(dateTime)}
      />
      <img src={pickerIcon} alt="" className={style.pickerIcon} />
    </div>
  );
};

export default ProFilePicker;
